import request from '@/utils/request'

// 查询卡密列表
export function listCardcode(query) {
  return request({
    url: '/cardcode/cardcode/list',
    method: 'get',
    params: query
  })
}
export function generateCardcode() {
  return request({
    url: '/cardcode/cardcode/genercode',
    method: 'post',
  })
}

// 查询卡密详细
export function getCardcode(id) {
  return request({
    url: '/cardcode/cardcode/' + id,
    method: 'get'
  })
}

// 新增卡密
export function addCardcode(data) {
  return request({
    url: '/cardcode/cardcode',
    method: 'post',
    data: data
  })
}

// 修改卡密
export function updateCardcode(data) {
  return request({
    url: '/cardcode/cardcode',
    method: 'put',
    data: data
  })
}

// 删除卡密
export function delCardcode(id) {
  return request({
    url: '/cardcode/cardcode/' + id,
    method: 'delete'
  })
}
